<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教师关联专业页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/bootstrap-responsive.min.css">
    <link rel="stylesheet" href="../../css/matrix-style2.css"/>
    <link rel="stylesheet" href="../../font-awesome/css/font-awesome.css"/>
    <link rel="stylesheet" href="../../css/select2.min.css"/>
    <link rel="stylesheet" href="../../css/common.css"/>
</head>
<body>
<div id="content">
    <div id="content-header">
        <h1>关联专业</h1>
    </div>

    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-content nopadding">
                        <form id="rel_major">
                            <input id="pkTeacher" name="pkTeacher" type="hidden" value=""/>
                            <div style="margin: 20px 0">
                                <label for="grade" class="from-title">年  级:</label>
                                <select id="grade" name="grade">
                                    <option selected value="">--请选择--</option>
                                </select>
                                <label for="major" class="from-title">专  业:</label>
                                <select id="major" name="pkMajor" style="height: 50px">
                                    <option selected value="">--请选择--</option>
                                </select>
                                <button type="button" class="btn btn-info left30" onclick="related()">关联</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-content nopadding">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th width="30%">年级</th>
                                <th width="50%">专业</th>
                                <th width="20%">操作</th>
                            </tr>
                            </thead>
                            <tbody id="tab">
                            </tbody>
                        </table>
                        <div class="paginationBox" id="paging">
                            <div class="pagination alternate">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="../../js/jquery-2.1.1.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/jquery.uniform.js"></script>
<script src="../../js/jquery.form.js"></script>
<script src="../../js/matrix.js"></script>
<script src="../../js/jquery.artDialog.js" type="text/javascript"></script>
<script src="../../js/iframeTools.js" type="text/javascript"></script>
<script src="../../js/common.js"></script>
<script src="../../js/select2.min.js"></script>
<script src="../../js/template.js"></script>
<script src="teacherManage.js" type="text/javascript"></script>
<script>
    $(function () {
        var pkTeacher = art.dialog.data('pkTeacher');
        $("#pkTeacher").val(pkTeacher);
        $('select').select2();
        getGrade();
        getTeacherMajor(pkTeacher);
    });
</script>
<!--用于存放模版-->
<!--年级模版-->
<script id="gradeModal" type="text/html">
    <option selected value="">--请选择--</option>
    {{each data as i}}
    <option>{{i}}</option>
    {{/each}}
</script>
<!--专业模版-->
<script id="majorModal" type="text/html">
    <option selected value="">--请选择--</option>
    {{each data as i}}
    <option value="{{i.pkMajor}}">{{i.major}}</option>
    {{/each}}
</script>
<script id="majorTable" type="text/html">
    {{if data.total == 0}}
    <tr>
        <td colspan=3>该教师未分配专业</td>
    </tr>
    {{else}}
    {{each data.list as i}}
    <tr>
        <td>{{i.grade}}</td>
        <td>{{i.major}}</td>
        <td><button type="button" class="btn btn-danger" onclick="del('{{i.pkMajor}}')">删除</button></td>
    </tr>
    {{/each}}
    {{/if}}
</script>
</html>